finding the sum of a finite geometric series